import httpInstance from "@/utils/http";

/**
 * 获取面包屑数据
 * @param {参数id} id 参数
 * @returns 返回面包屑数据
 */
export function getCategoryAPI(params){
  return httpInstance({
     url: '/category',
     params
  })
}

/**
 * 获取二级分类数据
 * @param {*} params id 参数
 * @returns 返回二级分类数据
 */
export function getCategoryFilterAPI(params){
  return httpInstance({
    url:'/category/sub/filter',
    params
  })
}

/**
 * @description: 获取导航数据
 * @data  {
    categoryId:123456,
    page:1,
    pageSize:20,
    sortField:'publishTime' | 'orderNum' |'evaluteNum'
  }
 * @returns 
 */
export const getSubCategoryAPI = (data)=>{
  console.log(data)
  return httpInstance({
    url:'/category/goods/temporary',
    method:'post',
    data
  })
}